home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / ssozumo.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  12KB  |  363 lines

  1. /***************************************************************************
  2.  
  3. Syusse Oozumou
  4. (c) 1984 Technos Japan (Licensed by Data East)
  5.  
  6. Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/10/04
  7.  
  8. ***************************************************************************/
  9.  
  10. #include "driver.h"
  11. #include "vidhrdw/generic.h"
  12. #include "cpu/m6502/m6502.h"
  13. #include "cpu/m6809/m6809.h"
  14.  
  15. extern unsigned char *ssozumo_videoram2, *ssozumo_colorram2;
  16. extern size_t ssozumo_videoram2_size;
  17. extern unsigned char *ssozumo_scroll;
  18.  
  19. WRITE_HANDLER( ssozumo_paletteram_w );
  20. void ssozumo_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable, const unsigned char *color_prom);
  21. void ssozumo_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  22. int ssozumo_vh_start(void);
  23. void ssozumo_vh_stop(void);
  24.  
  25.  
  26. static int ssozumo_interrupt(void)
  27. {
  28.     static int coin;
  29.  
  30.     if ((readinputport(0) & 0xc0) != 0xc0)
  31.     {
  32.         if (coin == 0)
  33.         {
  34.             coin = 1;
  35.             return nmi_interrupt();
  36.         }
  37.     }
  38.     else coin = 0;
  39.  
  40.     return interrupt();
  41. }
  42.  
  43.  
  44. WRITE_HANDLER( ssozumo_sh_command_w )
  45. {
  46.     soundlatch_w(offset, data);
  47.     cpu_cause_interrupt(1, M6502_INT_IRQ);
  48. }
  49.  
  50.  
  51. static struct MemoryReadAddress readmem[] =
  52. {
  53.     { 0x0000, 0x077f, MRA_RAM },
  54.  
  55.     { 0x2000, 0x27ff, MRA_RAM },
  56.     { 0x3000, 0x31ff, MRA_RAM },
  57.  
  58.     { 0x4000, 0x4000, input_port_0_r },
  59.     { 0x4010, 0x4010, input_port_1_r },
  60.     { 0x4020, 0x4020, input_port_2_r },
  61.     { 0x4030, 0x4030, input_port_3_r },
  62.  
  63.     { 0x6000, 0xffff, MRA_ROM },
  64.     { -1 }    /* end of table */
  65. };
  66.  
  67.  
  68. static struct MemoryWriteAddress writemem[] =
  69. {
  70.     { 0x0000, 0x077f, MWA_RAM },
  71.  
  72.     { 0x0780, 0x07ff, MWA_RAM, &spriteram, &spriteram_size },
  73.     { 0x2000, 0x23ff, MWA_RAM, &ssozumo_videoram2, &ssozumo_videoram2_size },
  74.     { 0x2400, 0x27ff, MWA_RAM, &ssozumo_colorram2 },
  75.     { 0x3000, 0x31ff, videoram_w, &videoram, &videoram_size },
  76.     { 0x3200, 0x33ff, colorram_w, &colorram },
  77.     { 0x3400, 0x35ff, MWA_RAM },
  78.     { 0x3600, 0x37ff, MWA_RAM },
  79.  
  80.     { 0x4000, 0x4000, MWA_RAM },            // fg page select?
  81.     { 0x4010, 0x4010, ssozumo_sh_command_w },
  82.     { 0x4020, 0x4020, MWA_RAM, &ssozumo_scroll },
  83. //    { 0x4030, 0x4030, MWA_RAM },
  84.     { 0x4050, 0x407f, ssozumo_paletteram_w, &paletteram },
  85.  
  86.     { 0x6000, 0xffff, MWA_ROM },
  87.     { -1 }    /* end of table */
  88. };
  89.  
  90.  
  91. static struct MemoryReadAddress sound_readmem[] =
  92. {
  93.     { 0x0000, 0x01ff, MRA_RAM },
  94.     { 0x2007, 0x2007, soundlatch_r },
  95.     { 0x4000, 0xffff, MRA_ROM },
  96.     { -1 }    /* end of table */
  97. };
  98.  
  99.  
  100. static struct MemoryWriteAddress sound_writemem[] =
  101. {
  102.     { 0x0000, 0x01ff, MWA_RAM },
  103.     { 0x2000, 0x2000, AY8910_write_port_0_w },
  104.     { 0x2001, 0x2001, AY8910_control_port_0_w },
  105.     { 0x2002, 0x2002, AY8910_write_port_1_w },
  106.     { 0x2003, 0x2003, AY8910_control_port_1_w },
  107.     { 0x2004, 0x2004, DAC_0_signed_data_w },
  108.     { 0x2005, 0x2005, interrupt_enable_w },
  109.     { 0x4000, 0xffff, MWA_ROM },
  110.     { -1 }    /* end of table */
  111. };
  112.  
  113.  
  114. INPUT_PORTS_START( ssozumo )
  115.     PORT_START    /* IN0 */
  116.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  117.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  118.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  119.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  120.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  121.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  122.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  123.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  124.  
  125.     PORT_START    /* IN1 */
  126.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  127.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  128.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  129.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  130.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  131.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  132.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  133.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  134.  
  135.     PORT_START      /* DSW2 */
  136.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Difficulty ) )
  137.     PORT_DIPSETTING(    0x01, "Normal" )
  138.     PORT_DIPSETTING(    0x00, "Hard" )
  139.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  140.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  141.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  142.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
  143.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  144.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  145.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  146.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  147.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  148.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  149.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  150.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  151.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  152.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  153.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  154.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  155.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  156.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  157.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  158.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  159.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  160.  
  161.     PORT_START      /* DSW1 */
  162.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
  163.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  164.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  165.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  166.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
  167.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
  168.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  169.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  170.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  171.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
  172.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  173.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  174.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  175. #if 0
  176.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
  177.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  178.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  179. #endif
  180.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
  181.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  182.     PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
  183.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  184. INPUT_PORTS_END
  185.  
  186.  
  187.  
  188. static struct GfxLayout charlayout =
  189. {
  190.     8,8,        /* 8*8 characters */
  191.     1024,        /* 1024 characters */
  192.     3,        /* 3 bits per pixel */
  193.     { 2*1024*8*8, 1024*8*8, 0 },    /* the bitplanes are separated */
  194.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  195.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  196.     8*8        /* every char takes 8 consecutive bytes */
  197. };
  198.  
  199.  
  200. static struct GfxLayout tilelayout =
  201. {
  202.     16,16,    /* 16*16 tiles */
  203.     256,    /* 256 tiles */
  204.     3,        /* 3 bits per pixel */
  205.     { 2*256*16*16, 256*16*16, 0 },    /* the bitplanes are separated */
  206.     { 16*8 + 0, 16*8 + 1, 16*8 + 2, 16*8 + 3, 16*8 + 4, 16*8 + 5, 16*8 + 6, 16*8 + 7,
  207.             0, 1, 2, 3, 4, 5, 6, 7 },
  208.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  209.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  210.     32*8        /* every tile takes 16 consecutive bytes */
  211. };
  212.  
  213.  
  214. static struct GfxLayout spritelayout =
  215. {
  216.     16,16,        /* 16*16 sprites */
  217.     1280,        /* 1280 sprites */
  218.     3,        /* 3 bits per pixel */
  219.     { 2*1280*16*16, 1280*16*16, 0 },    /* the bitplanes are separated */
  220.     { 16*8 + 0, 16*8 + 1, 16*8 + 2, 16*8 + 3, 16*8 + 4, 16*8 + 5, 16*8 + 6, 16*8 + 7,
  221.             0, 1, 2, 3, 4, 5, 6, 7 },
  222.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  223.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  224.     32*8        /* every sprite takes 16 consecutive bytes */
  225. };
  226.  
  227.  
  228. static struct GfxDecodeInfo gfxdecodeinfo[] =
  229. {
  230.     { REGION_GFX1, 0, &charlayout,     0, 4 },
  231.     { REGION_GFX2, 0, &tilelayout,   4*8, 4 },
  232.     { REGION_GFX3, 0, &spritelayout, 8*8, 2 },
  233.     { -1 }        /* end of array */
  234. };
  235.  
  236.  
  237. static struct AY8910interface ay8910_interface =
  238. {
  239.     2,        /* 2 chips */
  240.     1500000,    /* 1.5 MHz?????? */
  241.     { 30, 30 },
  242.     { 0 },
  243.     { 0 },
  244.     { 0 },
  245.     { 0 }
  246. };
  247.  
  248.  
  249. static struct DACinterface dac_interface =
  250. {
  251.     1,
  252.     { 30 }
  253. };
  254.  
  255.  
  256. static struct MachineDriver machine_driver_ssozumo =
  257. {
  258.     /* basic machine hardware */
  259.     {
  260.         {
  261.             CPU_M6502,
  262.             1200000,    /* 1.2 Mhz ???? */
  263.             readmem, writemem, 0, 0,
  264.             ssozumo_interrupt, 1
  265.         },
  266.         {
  267.             CPU_M6502 | CPU_AUDIO_CPU,
  268.             975000,         /* 975 kHz ?? */
  269.             sound_readmem, sound_writemem, 0, 0,
  270.             nmi_interrupt,16    /* IRQs are triggered by the main CPU */
  271.         }
  272.     },
  273.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  274.     1,                    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  275.     0,
  276.  
  277.     /* video hardware */
  278.     32*8, 32*8, { 0*8, 32*8 - 1, 1*8, 31*8 - 1 },
  279.     gfxdecodeinfo,
  280.     64 + 16, 64 + 16,
  281.     ssozumo_vh_convert_color_prom,
  282.  
  283.     VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE,
  284.     0,
  285.     ssozumo_vh_start,
  286.     ssozumo_vh_stop,
  287.     ssozumo_vh_screenrefresh,
  288.  
  289.     /* sound hardware */
  290.     0, 0, 0, 0,
  291.     {
  292.         {
  293.             SOUND_AY8910,
  294.             &ay8910_interface
  295.         },
  296.         {
  297.             SOUND_DAC,
  298.             &dac_interface
  299.         }
  300.     }
  301. };
  302.  
  303.  
  304.  
  305. ROM_START( ssozumo )
  306.     ROM_REGION( 0x10000, REGION_CPU1 )
  307.     /* Main Program ROMs */
  308.     ROM_LOAD( "ic61.g01",    0x06000, 0x2000, 0x86968f46 )    // m1
  309.     ROM_LOAD( "ic60.g11",    0x08000, 0x2000, 0x1a5143dd )    // m2
  310.     ROM_LOAD( "ic59.g21",    0x0a000, 0x2000, 0xd3df04d7 )    // m3
  311.     ROM_LOAD( "ic58.g31",    0x0c000, 0x2000, 0x0ee43a78 )    // m4
  312.     ROM_LOAD( "ic57.g41",    0x0e000, 0x2000, 0xac77aa4c )    // m5
  313.  
  314.     ROM_REGION( 0x10000, REGION_CPU2 )
  315.     /* Sound Program & Voice Sample ROMs*/
  316.     ROM_LOAD( "ic47.g50",    0x04000, 0x2000, 0xb64ec829 )    // a1
  317.     ROM_LOAD( "ic46.g60",    0x06000, 0x2000, 0x630d7380 )    // a2
  318.     ROM_LOAD( "ic45.g70",    0x08000, 0x2000, 0x1854b657 )    // a3
  319.     ROM_LOAD( "ic44.g80",    0x0a000, 0x2000, 0x40b9a0da )    // a4
  320.     ROM_LOAD( "ic43.g90",    0x0c000, 0x2000, 0x20262064 )    // a5
  321.     ROM_LOAD( "ic42.ga0",    0x0e000, 0x2000, 0x98d7e998 )    // a6
  322.  
  323.     ROM_REGION( 0x06000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  324.     /* Character ROMs */
  325.     ROM_LOAD( "ic22.gq0",    0x00000, 0x2000, 0xb4c7e612 )    // c1
  326.     ROM_LOAD( "ic23.gr0",    0x02000, 0x2000, 0x90bb9fda )    // c2
  327.     ROM_LOAD( "ic21.gs0",    0x04000, 0x2000, 0xd8cd5c78 )    // c3
  328.  
  329.     ROM_REGION( 0x06000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  330.     /* tile set ROMs */
  331.     ROM_LOAD( "ic69.gt0",    0x00000, 0x2000, 0x771116ca )    // t1
  332.     ROM_LOAD( "ic59.gu0",    0x02000, 0x2000, 0x68035bfd )    // t2
  333.     ROM_LOAD( "ic81.gv0",    0x04000, 0x2000, 0xcdda1f9f )    // t3
  334.  
  335.     ROM_REGION( 0x1e000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  336.     /* sprites ROMs */
  337.     ROM_LOAD( "ic06.gg0",    0x00000, 0x2000, 0xd2342c50 )    // s1a
  338.     ROM_LOAD( "ic05.gh0",    0x02000, 0x2000, 0x14a3cb10 )    // s1b
  339.     ROM_LOAD( "ic04.gi0",    0x04000, 0x2000, 0x169276c1 )    // s1c
  340.     ROM_LOAD( "ic03.gj0",    0x06000, 0x2000, 0xe71b9f28 )    // s1d
  341.     ROM_LOAD( "ic02.gk0",    0x08000, 0x2000, 0x6e94773c )    // s1e
  342.     ROM_LOAD( "ic29.gl0",    0x0a000, 0x2000, 0x40f67cc4 )    // s2a
  343.     ROM_LOAD( "ic28.gm0",    0x0c000, 0x2000, 0x8c97b1a2 )    // s2b
  344.     ROM_LOAD( "ic27.gn0",    0x0e000, 0x2000, 0xbe8bb3dd )    // s2c
  345.     ROM_LOAD( "ic26.go0",    0x10000, 0x2000, 0x9c098a2c )    // s2d
  346.     ROM_LOAD( "ic25.gp0",    0x12000, 0x2000, 0xf73f8a76 )    // s2e
  347.     ROM_LOAD( "ic44.gb0",    0x14000, 0x2000, 0xcdd7f2eb )    // s3a
  348.     ROM_LOAD( "ic43.gc0",    0x16000, 0x2000, 0x7b4c632e )    // s3b
  349.     ROM_LOAD( "ic42.gd0",    0x18000, 0x2000, 0xcd1c8fe6 )    // s3c
  350.     ROM_LOAD( "ic41.ge0",    0x1a000, 0x2000, 0x935578d0 )    // s3d
  351.     ROM_LOAD( "ic40.gf0",    0x1c000, 0x2000, 0x5a3bf1ba )    // s3e
  352.  
  353.     ROM_REGION( 0x0080, REGION_PROMS )
  354.     ROM_LOAD( "ic33.gz0",    0x00000, 0x0020, 0x523d29ad )    /* char palette red and green components */
  355.     ROM_LOAD( "ic30.gz2",    0x00020, 0x0020, 0x0de202e1 )    /* tile palette red and green components */
  356.     ROM_LOAD( "ic32.gz1",    0x00040, 0x0020, 0x6fbff4d2 )    /* char palette blue component */
  357.     ROM_LOAD( "ic31.gz3",    0x00060, 0x0020, 0x18e7fe63 )    /* tile palette blue component */
  358. ROM_END
  359.  
  360.  
  361.  
  362. GAMEX( 1984, ssozumo, 0, ssozumo, ssozumo, 0, ROT270, "Technos", "Syusse Oozumou (Japan)", GAME_NO_COCKTAIL )
  363.